package vo;

import java.sql.*;
public class User {
	private String xm = null;
	private String mm = null;
	private String realxm = null;
	
	public User() {}

	public User(String xm, String mm, String realxm) {
		super();
		this.xm = xm;
		this.mm = mm;
		this.realxm = realxm;
	}

	public String getXm() {
		return xm;
	}

	public void setXm(String xm) {
		this.xm = xm;
	}

	public String getMm() {
		return mm;
	}

	public void setMm(String mm) {
		this.mm = mm;
	}

	public String getRealxm() {
		return realxm;
	}

	public void setRealxm(String realxm) {
		this.realxm = realxm;
	}

	public boolean yanzheng_user(String xm2,String mm2) throws SQLException, ClassNotFoundException {
		boolean f = false;
		ConnectDbase cdb = new ConnectDbase();
		Connection conn = cdb.getConnect();
		String sql = "select username,userpwd from user where (username=? and userpwd=?)";
		PreparedStatement pstmt = conn.prepareStatement(sql);
		pstmt.setString(1, xm2);
		pstmt.setString(2, mm2);
		ResultSet rs = pstmt.executeQuery();
		if(rs.next()) {
			f =true;
		}else {
			f = false;
		}
		if(rs != null) {
			rs.close();
		}
		if(pstmt != null) {
			pstmt.close();
		}
		if(conn != null) {
			conn.close();
		}
		return f;
	}
}
